﻿@model IEnumerable<PessModel.PAuthor>

@{
   
    bool allowEdit = false;
    if (ViewBag.AllowEdit != null && ViewBag.AllowEdit == true) { 
        allowEdit = true;
    }

    var PAuthors = Model.OrderBy(pa => pa.Order);
}

<div class="displayConScroe" style="padding-top:0px; width:700px">
    <br/>
    <table id="pauthorstable" style="margin-top:0px; width: 700px">
        <tr>
            <th>
                Email Address
            </th>
            <th>
                Name
            </th>
            <th>
                Affiliation
            </th>
            <th>
                Country
            </th>
            <th>
                Role
            </th>
                <th style="width:100px; "></th>
        </tr>

        @for (int i = 0; i < PAuthors.Count();i++ )
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => PAuthors.ElementAt(i).EMail)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => PAuthors.ElementAt(i).Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => PAuthors.ElementAt(i).Organization)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => PAuthors.ElementAt(i).Country)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => PAuthors.ElementAt(i).TypeName)
                </td>


<td style="text-align:left; width:100px"></td>
                   @* @Html.ActionLink("Delete", "Delete", "PAuthor", new { id = PAuthors.ElementAt(i).ID, a = ViewBag.Action, c = ViewBag.Controller }, null)
        @if(i>0)
        {
            @Html.ActionLink("^", "Move", "PAuthor", new { id = PAuthors.ElementAt(i).ID, nid = PAuthors.ElementAt(i - 1).ID, a = ViewBag.Action, c = ViewBag.Controller }, null)
        }
        @if(i<(Model.Count()-1)){
            @Html.ActionLink("v", "Move", "PAuthor", new { id = PAuthors.ElementAt(i).ID, nid = PAuthors.ElementAt(i + 1).ID, a = ViewBag.Action, c = ViewBag.Controller }, null)
        }
    </td>
               *@
            </tr>
        }
        </table>
        </div>
